<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>

    <div id="app">
        <h2>{{date}}</h2>
        <form action="" @submit.prevent="post('123')">
            <button>提交</button>
        </form>

    </div>

<script>
    var app=new Vue({
        el:'#app',
        data: {
            date:new Date(),
        },
        methods:{
            post(item){
              alert(item);
            },


            },


    });

</script>
</body>
</html>